home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7891 < prev    next >
Encoding:
Text File  |  1996-08-05  |  904 b   |  45 lines

  1. Newsgroups: comp.lang.c++
  2. Path: bath.ac.uk!uwe-bristol!pa-ross
  3. From: pa-ross@uwe.ac.uk (P Ross)
  4. Subject: Linking external Stuff with Watcom c++
  5. Message-ID: <1996Feb17.103251.19696@pat.uwe.ac.uk>
  6. Sender: usenet@pat.uwe.ac.uk (uwe nntp usenet poster)
  7. Nntp-Posting-Host: usenet@pat.uwe.ac.uk (uwe nntp usenet poster)
  8. Organization: University of the West of England, Bristol
  9. X-Newsreader: Tin 1.1 PL5
  10. Date: Sat, 17 Feb 1996 10:32:51 GMT
  11.  
  12. Hi folks,
  13.  
  14. Does anyone know how to get external C to link into watcom c++ code ? (BTW the
  15. external C is watcom also)
  16.  
  17. A basic example, I have two files, main.cpp & bitmap.cpp
  18.  
  19. bitmap.cpp looks like
  20.  
  21. extern "C" {
  22.     uchar map[]=
  23.     {
  24.     0,1,2,3,4,5,6,7
  25.     }
  26. }
  27.  
  28. main.cpp looks like,
  29.  
  30. extern map;
  31. void main(void)
  32. {
  33.     cout<<"The address of the bitmap is "<<map<<endl;
  34. }
  35.  
  36. I can get it to compile but I keep getting the address as a NULL pointer :(
  37.  
  38. Can anyone help ?
  39.  
  40. Thanks,
  41.  
  42. Paul
  43.  
  44.  
  45.